package bs.app.Client;

import bs.app.Main.CCanvas;
import bs.app.Position.CPosition;
import bs.app.Res.CRess;
import bs.app.android.Graphics;

public class SplashScreen {
	public int x, y;
	public int time;

	public SplashScreen() {
		CRess.LoadLogo();
		x = CCanvas.s_iWcanvas / 2 - CRess.Logo.getWidth() / 2;
		y = CCanvas.s_iHcanvas / 2 - CRess.Logo.getHeight() / 2;
	}

	public void Paint(Graphics g) {
		g.setColor(0x000000);
		g.fillRect(0, 0, CCanvas.s_iWcanvas, CCanvas.s_iHcanvas);
		if (CRess.Logo != null)
			g.drawImage(CRess.Logo, x, y, CPosition.ANCHOR_LEFT_TOP);

	}

	public void UpdateKeyPress(boolean[] keyPressed, boolean[] keyHold, int currentAsccii[]) {
		Update();
	}

	public void Update() {
		time++;
		if (time == 5) {
			CCanvas.s_Instan.connect.setURL("");
			CCanvas.s_Instan.connect.URL.addElement("");
			CCanvas.s_Instan.connect.RequestServerGetData();
		}
	}
}
